# es batch的大小
BATCH_SIZE_ES = 100000


mapping ={
  "mappings" : {
    "properties" : {
      "id" : {
        "type" : "keyword"
      },
      "token" : {
        "type" : "keyword"
      },
      "material_name" : {
        "type" : "keyword"
      },
      "format_type" : {
        "type" : "keyword"
      },
      "material_title" : {
        "type" : "text"
      },
      "material_content": {
        "type": "text"
      },

      "material_time" : {
        "type" : "date",
        "format" : "yyyy-MM-dd HH:mm:ss||epoch_second"
      },
      "material_date" : {
        "type" : "date",
        "format" : "yyyy-MM-dd"
      },
      "material_category" : {
        "type" : "keyword"
      },
      "material_source" : {
        "type" : "keyword"
      },
      "material_type" : {
        "type" : "keyword"
      },
      "material_journal" : {
        "type" : "keyword"
      },
      "material_channel" : {
        "type" : "keyword"
      },
      "material_security" : {
        "type" : "keyword"
      },
      "material_security_id" : {
        "type" : "integer"
      },
      "material_level" : {
        "type" : "keyword"
      },
      "material_level_id" : {
        "type" : "integer"
      },
      "material_keywords" : {
        "type" : "keyword"
      },
      "material_summary" : {
        "type" : "text"
      },
      "entity_person" : {
        "type" : "keyword"
      },
      "entity_place" : {
        "type" : "keyword"
      },
      "entity_org" : {
        "type" : "keyword"
      },
      "uid" : {
        "type" : "keyword"
      },
      "upload_name" : {
        "type" : "keyword"
      },
      "upload_dep" : {
        "type" : "keyword"
      },
      "available_dep" : {
        "type" : "keyword"
      },
      "available_uid" : {
        "type" : "keyword"
      },
      "uploadtime" : {
        "type" : "date",
        "format" : "yyyy-MM-dd HH:mm:ss||epoch_second"
      },
      "upload_date" : {
        "type" : "date",
        "format" : "yyyy-MM-dd"
      },
      "auto_comp" : {
        "type" : "keyword"
      }
    }
  }

}

########################## 必须修改开始 ##################################

# 用户名
ELASTIC_USERNAME = "elastic"
# 用户密码
ELASTIC_PASSWORD = "iie123$%^"
# 集群地址
ELASTIC_ADDRESS = ["http://localhost:9222"]

# 索引名称
INDEX_NAME = "test_material"
# 分片大小
SHARDS = 1
# 副本大小
NUM_REPLICA = 0
MAX_RESULT_WINDOW = 100000
score_threshold = 0.04
top_ratio = 0.5
top_weight_ratio = 0.8

########################## 必须修改结束 ##################################
total_area = ["经济领域","核领域","政治领域","军事领域","科技领域","国土领域","社会领域","文化领域","网络领域","生态领域","资源领域","金融领域","太空领域","极地领域","深海领域","生物领域","海外利益领域","数据领域","人工智能领域","粮食领域"]
# 配置要更新的设置
settings = {
    "settings": {
        "number_of_shards": 1,
        "number_of_replicas": NUM_REPLICA,
        "max_result_window": MAX_RESULT_WINDOW
    }
}
